﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<SDT.Site.ViewModels.ProductListModels>" %>
<%@ Import Namespace="SDT.Lib.Helpers" %>
<%foreach (var item in Model.Products)
{ %>
<div class="sale">
        <a href="/product/details/<%=item.ID %>/<%=Html.ToUrlFriendly(item.Name)%>">
            <% string imgPath = (item.ImagePath != null && item.ImagePath != string.Empty) ? SDT.Lib.Common.Utils.GenThumbnail(item.ID, 156, 161, item.ImagePath, Model.ImagePath, Model.ImageUrl) : SDT.Lib.Common.Globals.DefaultLogo; %>
            <div class="discount">
                <span>Giảm</span>
                <div><%=string.Format("{0:0,0}", item.DiscountPercent) %>%</div>
            </div>
            <img src="<%=imgPath %>" title="<%=item.Name %>" alt="<%=item.Name %>" width="156px" height="161px"" />
         </a>
    </div>
<%} %>

